@extends("/paging_template",minWidth=1000,title="进货产品列表")
@import com.mgfireworks.mgplatform.mgadmin.sys.model.*
@import com.mgfireworks.mgplatform.mgadmin.product.model.*
@import com.mgfireworks.mgplatform.mgadmin.stock.model.*
@args Boolean isAgentOne=true
@args List<Stock> stockList, List<Organization> organizationList,List<Category> categoryList
<s_panel>
@if(isAgentOne){
    <s_select name="orgId" text="厂家" value="@val("orgId")">
    @if(organizationList){@for(Organization o : organizationList){
    <option value="@o.getOrgId()">@o.getOrgName()</option>
    }}
    </s_select>
}
    <s_select name="cateId" text="类别" value="@val("cateId")">
    @if(categoryList){@for(Category c : categoryList){
    <option value="@c.getCateId()">@c.getCateName()</option>
    }}
    </s_select>
    <s_input name="productId" text="产品编号" value="@val("productId")"></s_input>
    <s_input name="productName" text="产品名" value="@val("productName")"></s_input>
    <s_buttons slot="button" cols="2">
        <s_button type="query" col="5" icon="fa-search"></s_button>
        <s_button type="link" href="list.html" col="7" icon="fa-shopping-cart">去结算</s_button>
    </s_buttons>
</s_panel>

@section(form1){
    <div class="row">
        @if(stockList){
        @{int i=0;}
        @for(Stock s : stockList){
        <div class="js-partial-form product-item col col-sm-12 col-md-12 col-xs-12 col-lg-4">
            <input type="hidden" name="productId" value="@s.getProductId()"/>
            <input type="hidden" name="stockId" value="@s.getStockId()"/>
            <div class="thumbnail" style="height: auto;">
                <a href="?">
                    <img src="@url(s.getMainImg())" alt="@s.getProductName()">
                </a>
                <div class="caption">
                    <div class="pi-info">
                        <div class="pi-buttons row">
                            <div class="col-xs-6">
                                <num_changer name="num" value="1"></num_changer>
                            </div>
                            <a class="js-json-post btn btn-warning col-xs-5" href="addOrderItem.json" role="button" result="#jsDivSuccess"><i class="fa fa-shopping-cart"></i>加入清单</a>
                        </div>
                        <h3>@s.getProductName()</h3>
                        <p>类别：@s.getCategoryName()，品牌：@s.getBandName()</p>
                        <p>销售级别：@s.getSellLevelName()</p>
                        <p>库存：@s.getQuantity()， 价格：@s.getPrice()</p>
                    </div>
                </div>
            </div>
        </div>
        }}else{
        <div><i class="fa fa-exclamation-circle"></i>暂无产品!</div>
        }
    </div>
    <div id="jsDivSuccess" class="hidden">
        <h3>成功添加到订单!!!<a href="list.html" class="label label-danger">查看</a></h3>
    </div>
}